package com.cdks.wuxiu.api.service.mysql;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cdks.wuxiu.api.mapper.AppBannerConfigMapper;
import com.cdks.wuxiu.entity.mysql.AppBannerConfig;

import java.util.List;

import org.springframework.stereotype.Service;


/**
 * APP版本信息表 服务实现类
 */
@Service
public class AppBannerConfigServiceImpl extends ServiceImpl<AppBannerConfigMapper, AppBannerConfig> implements AppBannerConfigService {
    @Override
    public List<AppBannerConfig> getBannerByPlat(int plat) {
        QueryWrapper<AppBannerConfig> wrapper = new QueryWrapper<>();

        String lastSql  = "WHERE";
        lastSql += (" (plat&" + plat + ") > 0 ORDER BY sortIdx");

        return baseMapper.selectList(wrapper.last(lastSql));
    }
}
